package com.telenav.ui;


public class UiEvent
{   
    /**
     * {@link CommandEvent}
     */
    public final static int TYPE_COMMAND_EVENT = 1;

    /**
     * {@link KeyEvent}
     */
    public final static int TYPE_KEY_EVENT = 2;

    /**
     * {@link TnMotionEvent}
     */
    public final static int TYPE_TOUCH_EVENT = 3;

    /**
     * {@link TnMotionEvent}
     */
    public final static int TYPE_TRACKBALL_EVENT = 4;

    /**
     * {@link TnPrivateEvent}
     */
    public final static int TYPE_PRIVATE_EVENT = 5;
    
    private int eventType;
    private KeyEvent keyEvent;
    private CommandEvent commandEvent;
    
    /**
     * construct the ui event.
     * 
     * @param type
     * @param tnComponent
     */
    public UiEvent(int type)
    {
        this.eventType = type;
    }
    
    /**
     * retrieve the ui event type.
     * 
     * @return int
     */
    public int getType()
    {
        return eventType;
    }
    
    /**
     * retrieve the command event.
     * 
     * @return {@link CommandEvent}
     */
    public CommandEvent getCommandEvent()
    {
        return commandEvent;
    }
    
    /**
     * set the command event.
     * 
     * @param commandEvent
     */
    public void setCommandEvent(CommandEvent commandEvent)
    {
        this.commandEvent = commandEvent;
    }
    
    /**
     * retrieve the key event.
     * 
     * @return {@link KeyEvent}
     */
    public KeyEvent getKeyEvent()
    {
        return keyEvent;
    }
    
    /**
     * set key event.
     * 
     * @param keyEvent
     */
    public void setKeyEvent(KeyEvent keyEvent)
    {
        this.keyEvent = keyEvent;
    }
}